home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_asm
/
disasm
/
uasm-int.bas
< prev
next >
Wrap
BASIC Source File
|
1988-06-03
|
10KB
|
182 lines
10 '--------------------------------------------------------------------------
11 '| UASM-INT 1.06 23 Oct., 1983 White Crane Systems |
12 '| copyright 1983 Guy C. Gordon 3194 Friar Tuck Way |
13 '| Doraville, GA 30340 |
14 '| |
16 '| This program takes the Unassemble output from UASM-JMP and puts in |
22 '| Macros for the DOS interrupts. The Macro calls and Symbols are |
24 '| contained in the companion file UASM-DOS.MAC, which contains a |
26 '| table of Equates which may be included in the final .ASM listing. |
27 '| If you modify the table to suit your needs or taste, make certain |
30 '| that it meets the requirements of both this program and your |
32 '| assembler. |
40 '| |
42 '| For best speed, and to save wear on your floppy disk drives, |
44 '| specify the input and output files on separate drives. |
50 '********************************* NOTICE *********************************
51 '* USER SUPPORTED SOFTWARE (With thanks to Andrew Flugelman) *
52 '* *
53 '* A limited license is granted to all users of this program, to make *
54 '* copies of this program and distribute them to other users subject *
55 '* to the following conditions: *
56 '* 1. None of the notices or credits are to be bypassed, *
57 '* altered, or removed. *
58 '* 2. The program is not to be distributed in modified form. *
59 '* (Users are encouraged to distribute MERGE files.) *
60 '* 3. No fee is to be charged (or any other consideration *
61 '* received) for copying or distributing the program *
62 '* without an express written agreement with *
63 '* White Crane Systems. *
64 '**************************************************************************
70 CLS 'PRINT CHR$(27)+"E"; 'CLS
71 PRINT " UASM-INT
72 PRINT " White Crane Systems Unassembler - Interrupt Module
73 PRINT "
74 PRINT " If you are using this program and finding it of value
75 PRINT " please send a cash contribution to support its upkeep and
76 PRINT " distribution. Use the UASM system of programs to unas-
77 PRINT " semble one average length .COM file, look over the results
78 PRINT " and calculate how many hours this would have taken you to
79 PRINT " to produce, multiply by the minimum wage, contribute that
80 PRINT " amount and use the programs free thereafter. If that's too
81 PRINT " much just send $20. Supporters will receive free notice
82 PRINT " of enhancements and updates.
83 PRINT " In any case you are encouraged to copy and distribute
84 PRINT " UASM to your friends provided you do so free of charge and
85 PRINT " in unmodified form.
87 PRINT "
88 PRINT " Guy C. Gordon
89 PRINT " White Crane Systems
90 PRINT " 3194 Friar Tuck Way
91 PRINT " Doraville, GA 30340
92 PRINT "
100 DEFINT A-Z
110 TRUE=(1=1): FALSE=NOT TRUE
115 PRINT
120 INPUT "Enter name of input file: ", INFILE$
130 DR=INSTR(INFILE$,":"): EXT=INSTR(INFILE$,".")
140 IF EXT=0 THEN INFILE$=INFILE$+".JMP": EXT=INSTR(INFILE$,".")
150 INPUT "Enter name of output file: ", OUTFILE$
160 IF INSTR(OUTFILE$,":")=LEN(OUTFILE$) THEN OUTFILE$=OUTFILE$+MID$(INFILE$,DR+1,EXT-DR-1)
170 IF INSTR(OUTFILE$,".")=0 THEN OUTFILE$=OUTFILE$+".INT"
180 PRINT
190 GOSUB 1000 'Read UASM-DOS.MAC file
200 '------------------------------------------------------------------------
201 '| READ SOURCE FILE |
202 '------------------------------------------------------------------------
205 PRINT TIME$,"Reading "INFILE$: PRINT ,"Writing "OUTFILE$: PRINT
210 OPEN INFILE$ FOR INPUT AS #1
220 OPEN OUTFILE$ FOR OUTPUT AS #2
225 PRINT #2,"INCLUDE UASM-DOS.MAC"
230 WHILE NOT EOF(1)
235 ' Keep track of registers
240 LINE INPUT #1,A$
250 IF LEFT$(A$,1)="L" THEN AX$="": AH$="": AL$="": D$="" 'Entry point
260 IF MID$(A$,17,1)<>"A" THEN 300 'Found defnition of A
270 IF MID$(A$,18,1)="X" THEN AX$=MID$(A$,20): AH$="": AL$="": GOTO 310
280 IF MID$(A$,18,1)="H" THEN AH$=MID$(A$,20): GOTO 310
290 IF MID$(A$,18,1)="L" THEN AL$=MID$(A$,20): GOTO 310
300 IF MID$(A$,17,2)="DX" OR MID$(A$,17,2)="DL" THEN D$=MID$(A$,20)
310 ' Take care of INTerrupts
320 IF MID$(A$,9,3)="INT" THEN GOSUB 2000 ELSE PRINT #2, A$
380 WEND
385 PRINT: PRINT TIME$,"UASM-INT Complete." 'how can I get any work done
390 CLOSE: END 'when you keep interrupting me?
1000 '-------------------------------------------------------------------------
1001 '| READ INTERRUPT 21 SERVICE CODES |
1002 '-------------------------------------------------------------------------
1005 PRINT TIME$,"Reading UASM-DOS.MAC"
1010 ON ERROR GOTO 1110
1020 OPEN "UASM-DOS.MAC" FOR INPUT AS #1
1030 LINE INPUT #1,A$: MAXSERV=VAL("&H"+MID$(A$,2,2))
1040 DIM SERVICE$(MAXSERV+1),COMMENT$(MAXSERV+1)
1050 ON ERROR GOTO 0
1060 WHILE NOT EOF(1):
1070 LINE INPUT #1,A$
1080 IF LEFT$(A$,4)=";END" THEN 1120
1090 IF LEFT$(A$,1)<>";" THEN SERV=VAL("&H"+MID$(A$,19,2)): SERVICE$(SERV)=LEFT$(A$,12): COMMENT$(SERV)=MID$(A$,21)
1100 WEND
1110 ON ERROR GOTO 0
1120 CLOSE: RETURN
2000 '-------------------------------------------------------------------------
2001 '| INTERRUPT |
2002 '-------------------------------------------------------------------------
2010 INTERRUPT=VAL("&H"+MID$(A$,17,2))
2020 IF INTERRUPT=&H21 THEN 2100
2025 C$=CHR$(9)+";" 'tab
2030 IF INTERRUPT<=0 THEN 5000
2040 ON INTERRUPT GOTO 5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,9000,9100,9200,9300,9400,9500,9600,9700
2050 GOTO 10000
2099 '-------------------------------------------------------------------------
2100 '| Determine value of AH (service code) |
2101 '-------------------------------------------------------------------------
2105 IF INSTR(AH$," ")>0 THEN AH$=LEFT$(AH$,INSTR(AH$," ")-1)
2110 IF LEN(AH$)=2 THEN AH=VAL("&H"+AH$): GOTO 2200
2115 IF INSTR(AX$," ")>0 THEN AX$=LEFT$(AX$,INSTR(AX$," ")-1)
2120 IF LEN(AX$)=4 THEN AH=VAL("&H"+LEFT$(AX$,2)): GOTO 2200
2130 AH=MAXSERV+1 'Default value (null strings)
2140 IF LEN(AH$)<>0 THEN X$=AH$ ELSE X$=AX$
2150 GOTO 2300
2200 X$="" 'Define X$ if DX or DL is loaded for this call
2210 IF AH=2 OR (AH>=4 AND AH<= 6) OR AH=9 OR AH=&HA THEN X$=D$: GOTO 2300
2220 IF (AH>=&HE AND AH<=&H17) OR AH=&H1A OR AH=&H1C THEN X$=D$: GOTO 2300
2230 IF (AH>=&H21 AND AH<=&H28) THEN X$=D$: GOTO 2300
2240 IF AH=&H31 OR AH=&H33 OR AH=&H36 OR (AH>=&H38 AND AH<=&H3D) THEN X$=D$
2250 IF AH=&H41 OR AH=&H43 OR AH=&H47 OR AH=&H4B THEN X$=D$: GOTO 2300
2260 IF AH=&H4B OR AH=&H56 THEN X$=D$
2300 '
2310 PRINT #2, A$
2320 PRINT #2,: PRINT #2,"DOSCALL "+SERVICE$(AH)+X$+COMMENT$(AH)
2330 PRINT #2,: PRINT "DOSCALL "+SERVICE$(AH)+X$+COMMENT$(AH)
2350 RETURN
4000 '-----------------------------------------------------------------------
4001 '| Table of comments for each Interrupt |
4002 '-----------------------------------------------------------------------
5000 C$=C$+"Divide by Zero": GOTO 10000 'int 0
5100 C$=C$+"Single step": GOTO 10000 'int 1
5200 C$=C$+"Non-Maskable Interrupt (NMI)": GOTO 10000 'int 2
5300 C$=C$+"Break Point Instruction ('CC'x)":GOTO 10000 'int 3
5400 C$=C$+"Overflow": GOTO 10000 'int 4
5500 C$=C$+"Print Screen": GOTO 10000 'int 5
5600 C$=C$+"Reserved": GOTO 10000 'int 6
5700 C$=C$+"Reserved": GOTO 10000 'int 7
5800 C$=C$+"Timer (18.2 per second)": GOTO 10000 'int 8
5900 C$=C$+"Keyboard Interrupt": GOTO 10000 'int 9
6000 C$=C$+"Reserved": GOTO 10000 'int A
6100 C$=C$+"Reserved": GOTO 10000 'int B
6200 C$=C$+"Reserved": GOTO 10000 'int C
6300 C$=C$+"Reserved": GOTO 10000 'int D
6400 C$=C$+"Diskette Interrupt": GOTO 10000 'int E
6500 C$=C$+"Reserved": GOTO 10000 'int F
7000 C$=C$+"Video I/O Call": GOTO 10000 'int 10
7100 C$=C$+"Equipment check": GOTO 10000 'int 11
7200 C$=C$+"Memory check": GOTO 10000 'int 12
7300 C$=C$+"Diskette I/O Call": GOTO 10000 'int 13
7400 C$=C$+"RS232 I/O Call": GOTO 10000 'int 14
7500 C$=C$+"Cassette I/O Call": GOTO 10000 'int 15
7600 C$=C$+"Keyboard I/O Call": GOTO 10000 'int 16
7700 C$=C$+"Printer I/O Call": GOTO 10000 'int 17
7800 C$=C$+"ROM Basic Entry Code": GOTO 10000 'int 18
7900 C$=C$+"Boot Strap Loader": GOTO 10000 'int 19
8000 C$=C$+"Time of Day Call": GOTO 10000 'int 1A
8100 C$=C$+"Get Control on Keyboard Break": GOTO 10000 'int 1B
8200 C$=C$+"Get Control on timer interrupt": GOTO 10000 'int 1C
8300 C$=C$+"Pointer to video initialization table": GOTO 10000 'int 1D
8400 C$=C$+"Pointer to diskette parameter table": GOTO 10000 'int 1E
8500 C$=C$+"Pointer to graphics Char. gen. table": GOTO 10000 'int 1F
9000 C$=C$+"DOS Program Terminate": GOTO 10000 'int 20
9100 GOTO 2100 'DOS Function Call 'int 21
9200 C$=C$+"DOS Terminate Address": GOTO 10000 'int 22
9300 C$=C$+"DOS CTRL-BRK Exit Address (^C)": GOTO 10000 'int 23
9400 C$=C$+"DOS Fatal Error Vector": GOTO 10000 'int 24
9500 C$=C$+"DOS Absolute Disk read": GOTO 10000 'int 25
9600 C$=C$+"DOS Absolute Disk write": GOTO 10000 'int 26
9700 C$=C$+"DOS Terminate, Fix in Storage": GOTO 10000 'int 27
9997 '-----------------------------------------------------------------------
9998 '| Print INT instruction with comment |
9999 '-----------------------------------------------------------------------
10000 PRINT #2,: PRINT #2, A$+C$: PRINT #2,
10010 PRINT A$+C$
10020 RETURN
10030 'End of program UASM-INT